Red Hat JBoss Fuse Integration Partner Day
Charles Moulliard (@cmoulliard)
Architect, Engineer & Committer
13th of May - 2014
Projects timeline
High level presentation
Technology overview
Architectures design
Demos
A few things about Fuse & OpenSource
Projects timeline
High level presentation
Technology overview
Architectures design
Demos
2 products JBoss Fuse & AMQ
Designed around Multi-Technology OSGI Container
Packaging of Open Sources projects :
Camel,
Cxf,
ActiveMQ,
Fabric8,
Hawtio
Enables integration everywhere for a real-time enterprise
An open source messaging platform
Projects timeline
High level presentation
Technology overview
Architectures design
Demos
|
|
|
OpenSource Java Integration Framework
Designed around : Domain Specific Language
Implement Enterprise Integration Patterns
> 50 patterns implemented
and more : Loadbalancer, Throttler, Delayer, …
|
Key features : route, processor
Interceptor : trace, log, capture business events
|
|
|
|
Data Transformation for complex use case
package org.devnation.camel;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.camel.Exchange;
public interface DataFormat {
void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception;
Object unmarshal(Exchange exchange, InputStream stream) throws Exception;
}Marshalling : Object XML (JAXB)
Unmarshalling : XML Object (JAXB)
Fluent API
package org.devnation.camel;
import org.apache.camel.builder.RouteBuilder;
public class ExampleRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("amq:queue:quotes")
.filter().xpath("/quote/product/ = 'widget")
.bean("QuotesService", "widget")
.filter().xpath("/quote/product/ = 'gadget")
.bean("QuotesService","gadget");
}
}Alternative : Spring, Blueprint DSL
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
<bean id="quotesService" class="org.devnation.camel.QuotesService"/>"
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="amq:queue:quotes"/>
<filter>
<xpath>"/quote/product/ = 'widget"</xpath>
</filter>
<bean id="quotesService" method="widget"/>
<filter>
<xpath>"/quote/product/ = 'gadget"</xpath>
</filter>
<bean id="quotesService" method="gadget"/>
</route>
</camelContext>
</beans>In memory bus / alternative to JBI, SCA, NMR
Transport objects : XML, File, Stream, Bytes
Predicate & Expression language (xslt, xpath, …)
Sync/Async exchanges
Threads Management,
Tx Architecture
Error and exception handling
Policy driven
Container agnostic
Simplify creation & deployment of web/REST services
2 approaches “java wsdl” or “wsdl java”
Support :
JAX-WS : Web Services (XML/SOAP)
JAX-RS : REST service (JSON)
SOAP 1.1, 1.2, WSDL 1.1, WS-Security, WS-Addressing, WS-RM
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/myService.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://camel.apache.org/schema/cxf"
...
<cxf:cxfEndpoint id="reportIncident"
address="http://localhost:{{port}}/camel-example/webservices/incident"
wsdlURL="etc/report_incident.wsdl"
serviceClass="org.apache.camel.example.ReportIncidentEndpoint"/>
...
<route>
<from uri="cxf:bean:reportIncident"/>
<convertBodyTo type="org.apache.camel.example.reportincident.InputReportIncident"/>
<transform>
<method bean="responseBean" method="getOK"/>
</transform>Java Micro-Container
OSGI Runtime
Offer modularity for Services
Multi-Technology platform
SSH server
Administration platform (local, remote, web, jmx)
Provisioning system (features)
Hot deployment and configuration management
Instances management
Security integration (JAAS)
Technology Camel, CXF, ActiveMQ, Spring, Fabric, …
Modular platform (deploy or remove container/libraries)
High performance, reliable JMS messaging fabric
Supporting JMS, C, C++, .Net, Stomp clients
Point to Point
Producer sends messages to a queue.
Consumer listens for messages from the queue
Messages are stored until read (or expired)
Messages can be persisted, are read only once.
Publish To Subscribe
A JMS client sends message to the topic.
JMS broker sends message to all subscribers that are currently alive.
Messages are consumed x times (relation 1 to many)
Opensource integration project - http://fabric8.io
Goals :
Configuring, provisioning & running Fuse on any machines physical, virtual, private, public, cloud …
Virtualize services (endpoints), processes
Propose ElasticSearch Storage engine (insight)
|
Fabric extend the possibilities
Management rely on Zookeeper server (ensemble of 1,3, 5 or servers)
& Fabric Agents
They will communicate with Zk server to :
register container info (ports, services, endpoints, processes)
get their provisioning
Provisioning = Behavior of a container, achieved with Profiles
Enveloppe(s) containing artifacts to be deployed or parameters to be configured
Can be versioned, facilitate mngt - rollback
Virtualization Create “indirection” points
Load balancing and failover
Easy elastic scaling of services
High-availability, Replication
Insight Technology
NoSQL storage for JSon documents
Designed around ElasticSearch
Dashboard
Full Text Search features
Collect
Logs,
Camel metrics,
JMX metrics,
Own data metrics
Create a bean recuperating Message/Exchange using @Header, @Body
Store it using org.fusesource.insight.storage.StorageService
import org.apache.camel.Header;
import org.fusesource.insight.storage.StorageService;
import java.sql.Timestamp;
import java.util.Date;
public class StoreService {
private static String ES_TYPE = "insight-tweet";
private static StorageService storageService;
public static void store(@Header("tweet-full") String data) {
storageService.store(ES_TYPE, generateTimeStamp(), data);
}
|
Extend the dashboard & plugins
TODO
Projects timeline
High level presentation
Technology overview
Architectures design
Demos
The BUS operates the exchanges between the endpoints using Camel (local) or NMR (global)
Decoupling "services" from integration layer
Karaf runs Jetty Web Server
Web Project can be registered using OSGI HTTP Service
Projects timeline
High level presentation
Technology overview
Architectures design
Demos
Apache Camel & WebServices
Apache Karaf - POJO + Messaging + Web
Apache ActiveMQ - High Availability with Network of Brokers
Fabric8 - Virtualization of Camel endpoints / loadbalancing
|
More info
www.jboss.org/products/fuse.html
www.redhat.com/products/jbossenterprisemiddleware/fuse/